package com.offcn.sellergood.controller;
import com.offcn.sellergood.pojo.Item;
import com.offcn.sellergood.service.ItemService;
import com.offcn.entity.PageResult;
import com.offcn.entity.Result;
import com.offcn.entity.StatusCode;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/****
 * @Author:ujiuye
 * @Description:
 * @Date 2021/2/1 14:19
 *****/
@Api(tags = "ItemController")
@RestController
@RequestMapping("/item")
@CrossOrigin
public class ItemController {

    @Autowired
    private ItemService itemService;
    /***
     * 根据审核状态查询Sku
     * @param status
     * @return
     */
    @GetMapping("/status/{status}")
    public Result<List<Item>> findByStatus(@PathVariable String status){
        System.out.println(1);
        List<Item> list = itemService.findByStatus(status);
        System.out.println(list);
        return new Result<List<Item>>(true,StatusCode.OK,"查询成功",list);
    }
}
